{php}
$values=$row['values'];
{/php}
<style>
    .fieldlist dd ins {
        width: 27% !important;
    }

    .fieldlist dd input:first-child {
        width: 100% !important;
    }

    .form-inline .selectpicker {
        width: 100% !important;
        left: 0 !important;
    }
    .panel-intro{
        background-color: #f6f6f6;
        padding: 15px;
    }
    legend{
        font-weight: bold;
    }
</style>
<div class="panel panel-default panel-intro">

    <form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
        <div class="panel-body">
            <div id="myTabContent" class="tab-content">
                <!--@formatter:off-->
                <div class="tab-pane fade active in" id="min">
                    <div class="widget-body no-padding">

                        <div class="row">
                            <div class=" form-group">
                                <label for="c-describe"
                                       class="control-label col-xs-12 col-sm-2">{:__('通知模板名称')}:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input id="c-describe" data-rule="required" type="text" class="form-control"
                                           name="row[describe]" value="{$row.describe?$row.describe:''}" readonly/>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2">{:__('参数类型')}:</label>
                                <div class="col-xs-12 col-sm-8">

                                    {:build_select('row[values][param_type]',
                                    $modelList,isset($values.param_type)?$values.param_type:'customer',
                                    ['class'=>'form-control selectpicker',
                                    'data-rule'=>'required','id'=>'c-param_type'])}
                                    <span class="text-gray">{:__("")}</span>
                                </div>
                            </div>

                            <!--公众号-->
                            <legend>公众号模板消息</legend>

                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2">{:__('模板编号')}:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input id="c-tpl_id" data-rule="required" class="form-control"
                                           name="row[values][tpl_id]" type="text"
                                           value="{:isset($values['tpl_id'])?$values['tpl_id']:''}">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2">{:__('跳转页面')}:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input id="c-url"  class="form-control"
                                           name="row[values][url]" type="text"
                                           value="{:isset($values['url'])?$values['url']:''}">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2">{:__('模板参数')}:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <dl class="fieldlist" data-template="content-tpl" data-name="content"
                                        data-tpl='{$template_data}'>
                                        <dd>
                                            <ins>{:__('参数')}</ins>
                                            <ins>{:__('值')}</ins>
                                            <ins>{:__('默认值')}</ins>
                                        </dd>
                                        <dd>
                                            <a href="javascript:;" class="btn btn-sm btn-success btn-append">
                                                <i class="fa fa-plus"></i> {:__('Append')}
                                            </a>
                                        </dd>
                                        <!--请注意 dd和textarea间不能存在其它任何元素，实际开发中textarea应该添加个hidden进行隐藏-->
                                        <textarea name="content" data-rule="required" class="form-control hide"
                                                  cols="30" rows="5">

                                        {:isset($values['content'])?$values['content']:''}
                                    </textarea>


                                    </dl>

                                    <script id="content-tpl" type="text/html">
                                        <dd class="form-inline">
                                            <ins><input type="text" name="<%=name%>[<%=index%>][value]"
                                                        class="form-control"
                                                        value="<%=row.value%>" placeholder="内容"/></ins>
                                            <ins>
                                                <select class="form-control selectpicker"
                                                        name="<%=name%>[<%=index%>][key]">
                                                    <% for(let i in data.tpl){ %>
                                                    <option value="<%= i %>"
                                                    <%=row.key==i?'selected':'' %> >
                                                    <%=data.tpl[i]%>
                                                    </option>
                                                    <% } %>
                                                </select>
                                            </ins>
                                            <ins><input type="text" name="<%=name%>[<%=index%>][def_val]"
                                                        class="form-control" value="<%=row.def_val%>"
                                                        placeholder="默认值"/>
                                            </ins>
                                            <!--下面的两个按钮务必保留-->
                                            <span class="btn btn-sm btn-danger btn-remove"><i
                                                    class="fa fa-times"></i></span>
                                            <span class="btn btn-sm btn-primary btn-dragsort"><i
                                                    class="fa fa-arrows"></i></span>
                                        </dd>
                                    </script>


                                </div>


                            </div>
                            <!--小程序end-->


                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2">{:__('状态')}:</label>
                                <div class="col-xs-12 col-sm-8">
                                    {:build_select('row[status]', [1=>'正常','0'=>'禁用'], $row['status'],
                                    ['class'=>'form-control selectpicker', 'data-rule'=>'required'])}
                                    <span class="text-gray"></span>
                                </div>
                            </div>
                        </div>

                        <div class="form-group layer-footer">
                            <label class="control-label col-xs-12 col-sm-2"></label>
                            <div class="col-xs-12 col-sm-8">
                                <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
                                <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
                            </div>
                        </div>

                    </div>
                </div>

                <div class="tab-pane fade" id="mp">
                    dsds

                </div>

                <!--@formatter:on-->
            </div>
        </div>
    </form>
</div>





















